package com.huifaapp.mall.adapter.adapter2;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * @desc
 * @auth Mr Wu Fan
 * Created by you on 2018/3/17.
 */

public class ViewPagerAdatperpopwindow extends PagerAdapter {
//    private    int  idex;
    private List<View> mViewList ;
    public ViewPagerAdatperpopwindow(List<View> mViewList  ) {
        this.mViewList = mViewList;
//        this.idex = idex;
    }

    @Override
    public int getCount() {
        return mViewList.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {

        container.addView(mViewList.get(position));
        return mViewList.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mViewList.get(position));
    }

}
